<template>
  <div>
    <div>08-子组件,父组件传过来的值：{{ props.name }}</div>
    <button @click="setName">改变父组件值</button>
  </div>
</template>

<script>
export default {
  props: {
    name: {
      type: String,
    },
  },
  setup(props, context) {
    console.log(props.name);
    function setName() {
      const sonName = "胖鸡";
      context.emit("getName", sonName);
    }
    return {
      props,
      setName,
    };
  },
};
</script>

<style>
</style>